package br.ucb.sigplan.action.impl;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import br.ucb.sigplan.action.Action;
import br.ucb.sigplan.beans.PlanoEnsino;
import br.ucb.sigplan.beans.Turma;
import br.ucb.sigplan.crud.PlanoEnsinoCrud;

public class AbrirAlteraPlanoAction implements Action {

	@Override
	public String execute(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		Integer idTurma = (Integer) req.getSession().getAttribute("turma");
		PlanoEnsino plano = PlanoEnsinoCrud.findByTurma(new Turma(idTurma));
		req.setAttribute("plano", plano);
		return "/jsp/professor/plano/profAlteraPlano.jsp";
	}

}
